get status
Retrieve the current status of the TabNews API using the MCP server's integration tool, enabling real-time monitoring and interaction with TabNews data.
Instructions
get status from tabnews api
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- src/tools/status.ts:25-44 (handler)The handler function for the 'get status' tool, which fetches the API status using getApiStatus and returns it formatted as MCP text content.handler: async (): Promise<McpResponse> => { try { const result = await getApiStatus(); const content: McpTextContent = { type: "text", text: `API Status:\n\n${JSON.stringify(result, null, 2)}`, }; return { content: [content], }; } catch (error) { if (error instanceof Error) { throw new Error(`Failed to check API status: ${error.message}`); } else { throw new Error("Failed to check API status"); } } },
- src/index.ts:24-29 (registration)Registration of the 'get status' tool (imported as checkStatusTool) on the MCP server instance.server.tool( checkStatusTool.name, checkStatusTool.description, checkStatusTool.parameters, checkStatusTool.handler );
- src/services/api.ts:15-20 (helper)Helper function that performs the actual API call to retrieve the status from TabNews API, used by the tool handler.export async function getApiStatus(): Promise<GetStatusResponse> { const response = await fetch(`${TABNEWS_API_URL}/status`); const data = await response.json(); return data as GetStatusResponse; }
- src/tools/status.ts:22-24 (schema)Tool schema definition including name, description, and empty parameters schema for the 'get status' tool.name: "get status", description: "get status from tabnews api", parameters: {},